import request from '@/utils/request'

// 获取部门负责人
export function getEmployeesSimples() {
  return request({
    url: '/sys/user/simple'
  })
}

// 获取员工列表
export function getEmployees(page, size) {
  return request({
    methods: 'get',
    url: '/sys/user',
    params: { page, size }
  })
}
export function addEmployee(data) {
  return request({
    method: 'post',
    url: '/sys/user',
    data
  })
}
export function delEmployee(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}
export function addEmployeeBatch(data) {
  return request({
    method: 'post',
    url: `/sys/user/batch`,
    data
  })
}
export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
export function assignRoles(data) {
  return request({
    url: `/sys/user/assignRoles`,
    method: 'put',
    data
  })
}

